Stop the drag if the grab is broken.
authorMatthias Clasen <mclasen@redhat.com>
Sun, 26 Jun 2005 06:39:19 +0000 (06:39 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 26 Jun 2005 06:39:19 +0000 (06:39 +0000)
2005-06-26  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkhsv.c (gtk_hsv_grab_broken): Stop the drag if
the grab is broken.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkhsv.c

index 96e4d4d5f8b9784b2572272f022f6de36b58a267..98d0aeb4856ea72a2a4a053345be7966872fcba2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-06-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkhsv.c (gtk_hsv_grab_broken): Stop the drag if
+       the grab is broken.
+
        * gtk/gtkcombobox.c (gtk_combo_box_popdown): Don't do 
        explicitly ungrab pointer and keyboard. We're unmapping
        the grab window anyway. 
index 96e4d4d5f8b9784b2572272f022f6de36b58a267..98d0aeb4856ea72a2a4a053345be7966872fcba2 100644 (file)
@@ -1,5 +1,8 @@
 2005-06-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkhsv.c (gtk_hsv_grab_broken): Stop the drag if
+       the grab is broken.
+
        * gtk/gtkcombobox.c (gtk_combo_box_popdown): Don't do 
        explicitly ungrab pointer and keyboard. We're unmapping
        the grab window anyway. 
index 96e4d4d5f8b9784b2572272f022f6de36b58a267..98d0aeb4856ea72a2a4a053345be7966872fcba2 100644 (file)
@@ -1,5 +1,8 @@
 2005-06-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkhsv.c (gtk_hsv_grab_broken): Stop the drag if
+       the grab is broken.
+
        * gtk/gtkcombobox.c (gtk_combo_box_popdown): Don't do 
        explicitly ungrab pointer and keyboard. We're unmapping
        the grab window anyway. 
index 58ea87922d4a942b677d0494be18c83b5c04e5d8..e8dbc19c59d63e142c7b17d860eef6420a84d070 100644 (file)
@@ -106,6 +106,8 @@ static gint     gtk_hsv_motion         (GtkWidget        *widget,
                                        GdkEventMotion   *event);
 static gint     gtk_hsv_expose         (GtkWidget        *widget,
                                        GdkEventExpose   *event);
+static gboolean gtk_hsv_grab_broken    (GtkWidget          *widget,
+                                       GdkEventGrabBroken *event);
 static gboolean gtk_hsv_focus          (GtkWidget        *widget,
                                        GtkDirectionType  direction);
 static void     gtk_hsv_move           (GtkHSV           *hsv,
@@ -177,6 +179,7 @@ gtk_hsv_class_init (GtkHSVClass *class)
   widget_class->motion_notify_event = gtk_hsv_motion;
   widget_class->expose_event = gtk_hsv_expose;
   widget_class->focus = gtk_hsv_focus;
+  widget_class->grab_broken_event = gtk_hsv_grab_broken;
   
   hsv_class->move = gtk_hsv_move;
   
@@ -773,6 +776,20 @@ set_cross_grab (GtkHSV *hsv,
   gdk_cursor_unref (cursor);
 }
 
+static gboolean 
+gtk_hsv_grab_broken (GtkWidget          *widget,
+                    GdkEventGrabBroken *event)
+{
+  GtkHSV *hsv = GTK_HSV (widget);
+  HSVPrivate *priv;
+  
+  priv = hsv->priv;
+  
+  priv->mode = DRAG_NONE;
+  
+  return TRUE;
+}
+
 /* Button_press_event handler for the HSV color selector */
 static gint
 gtk_hsv_button_press (GtkWidget      *widget,